<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:constants="http://www.tuanzi.com/constants/tags"
	xmlns:security="http://www.springframework.org/security/tags"
	template="/templates/template.xhtml">
	<ui:define name="title">外部手机号导入</ui:define>
	<ui:define name="content">
		<h:form>
			<div class="ui-fluid" style="padding-top: 0px;">
				<div class="ui-g">
					<div class="ui-g-12">
						<div class="card">
							<p:panelGrid columns="7" layout="grid"
								styleClass="ui-panelgrid-blank"
								style="border:0px none; background-color:transparent;">

								<p:fileUpload
										fileUploadListener="#{externalPhoneRecordBean.handleExternalPhone}"
										mode="advanced" auto="true"
										sizeLimit="#{constants:get('UPLOAD_FILE_SIZE')}"
										allowTypes="/(\.|\/)(txt)$/" label="选择文件（.txt）"
										invalidFileMessage="文件格式不正确" />
								<p:outputLabel for="source" value="填写号码来源"  />
								<p:inputText id="source" required="true"
									value="#{externalPhoneRecordBean.source}" />


								
								<p:commandButton value="校验文件" update="@form" actionListener="#{externalPhoneRecordBean.onCheck}"/>
								
								<p:commandButton value="导入"  actionListener="#{externalPhoneRecordBean.onSave}" icon="fa fa-upload" update="@form">
									<p:confirm 
										header="文件存在#{externalPhoneRecordBean.totalCount}条有效数据"
										message="其中#{externalPhoneRecordBean.repeatCount}条已存在，不导入" />
								</p:commandButton>
								<p:confirmDialog global="true" showEffect="fade" hideEffect="fade" >
							        <p:commandButton value="是" type="button" update="@form" styleClass="ui-confirmdialog-yes" icon="ui-icon-check" />
							        <p:commandButton value="否" type="button" styleClass="ui-confirmdialog-no" icon="ui-icon-close" />
							    </p:confirmDialog>
							</p:panelGrid>

						</div>

					</div>
				</div>
			</div>
		</h:form>
	</ui:define>
</ui:composition>
